package com.atguigu.springcloud.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * consul 生产者
 *
 * @author lhn
 * @date 2022/04/12 10:06
 * @since 1.0.0
 **/
@RestController
@Slf4j
@RequiredArgsConstructor
public class OrderConsulController {

    public static final String INVOKE_URL = "http://consul-provider-payment";

    private final RestTemplate restTemplate;

    @GetMapping(value = "/consumer/consul")
    public String paymentInfo() {
        return restTemplate.getForObject(INVOKE_URL + "/payment/consul", String.class);
    }

}